// 引入依赖项
import { Navigate, useRoutes } from "react-router-dom";

import Layout from "@/layout";
// 登录注册
import Login from "@/pages/Login";
import Register from "@/pages/Register";
//车辆服务管理
import Insurance from "@/pages/Service/Insurance";
import Raise from "@/pages/Service/Raise";
import Remind from "@/pages/Service/Remind";
import Year from "@/pages/Service/Year";
// 门店管理
import StoreManage from "@/pages/store/storeManage";
import StaffManage from "@/pages/store/staffManage";

// 统计分析
import UserStatistics from "@/pages/Statistics/userStatistics";
import OrderStatistics from "@/pages/Statistics/orderStatistics";
import VehicleStatistics from "@/pages/Statistics/vehicleStatistics";

//车辆信息管理
import MessageVehicle from "@/pages/Message/vehicle";
import MessageDispatch from "@/pages/Message/dispatch";
import VehicleModel from "@/pages/Message/VehicleModel";
// 客户管理
import PersonCustom from "@/pages/custom/personCustom";
import EnterpriseCustom from "@/pages/custom/enterpriseCustom";
import Blacklist from "@/pages/custom/blacklist";
// 系统设置
import Settings from "@/pages/Settings";
// 订单管理
import Order from "@/pages/order";
//404页面
import NotFound from "@/components/NotFound";
const GetRouters = () => {
  const routes = useRoutes([
    // 默认路由
    {
      path: "/",
      element: <Navigate to="/index" />,
    },
    {
      path: "/index",
      element: <Layout />,
      children: [
        {
          path: "insurance",
          element: <Insurance />,
        },
        {
          path: "raise",
          element: <Raise />,
        },
        {
          path: "remind",
          element: <Remind />,
        },
        {
          path: "year",
          element: <Year />,
        },
        {
          path: "storeManage",
          element: <StoreManage />,
        },
        {
          path: "staffManage",
          element: <StaffManage />,
        },
        {
          path: "userStatistics",
          element: <UserStatistics />,
        },
        {
          path: "orderStatistics",
          element: <OrderStatistics />,
        },
        {
          path: "vehicleStatistics",
          element: <VehicleStatistics />,
        },
        {
          path: "personCustom",
          element: <PersonCustom />,
        },
        {
          path: "enterpriseCustom",
          element: <EnterpriseCustom />,
        },
        {
          path: "blacklist",
          element: <Blacklist />,
        },
        {
          path: "cheguan",
          element: <MessageVehicle />,
        },
        {
          path: "settings",
          element: <Settings />,
        },
        {
          path: "chediao",
          element: <MessageDispatch />,
        },
        {
          path: "chexing",
          element: <VehicleModel />,
        },
        {
          path: "order",
          element: <Order />,
        },
      ],
    },
    {
      path: "/login",
      element: <Login />,
    },
    {
      path: "/register",
      element: <Register />,
    },
    {
      path: "*",
      element: <NotFound />,
    },
  ]);
  return routes;
};

export default GetRouters;
